<!-- 教学管理-班级学生-学生资料 -->
<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-common-layout-center">
      <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>
          
          <el-col :span="6">
            <el-form-item label="学校名称">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="学年届">
              <el-input v-model="listQuery.fcatno" placeholder="学年届" clearable />
            </el-form-item>
          </el-col>

          
          <template v-if="showAll">

          <el-col :span="6">
            <el-form-item label="年级名称">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options2"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="所属班级">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options3"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="学生名称">
              <el-input v-model="listQuery.fcatname" placeholder="学生名称" clearable />
            </el-form-item>
          </el-col>

        </template>

          <el-col :span="12">
            <el-form-item label="">
              <el-button type="primary" icon="el-icon-search" @click="getlist">查询</el-button>
              <el-button type="success" icon="el-icon-plus" @click="insert(undefined)">新增</el-button>
              <el-button type="warning" icon="el-icon-upload2">导入</el-button>
              <el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">展开</el-button>
              <el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>收起</el-button>
            </el-form-item>
          </el-col>

        </el-form>
      </el-row>
      <div class="JNPF-common-layout-main JNPF-flex-main">
        <JNPF-table :data="list" border v-loading="loading">
          <el-table-column prop="FHOME" label="学校名称"></el-table-column>
          <el-table-column prop="FYEAR" label="学年届" width="95"></el-table-column>
          <el-table-column prop="FPARENTNO" label="所属年级" ></el-table-column>
          <el-table-column prop="FCLASS" label="所属班级"></el-table-column>
          <el-table-column prop="FCATNO" label="身份证号" ></el-table-column>
          <el-table-column prop="FCATNAME" label="学生姓名"></el-table-column>
          <el-table-column prop="FSEX" label="性别" width="85"></el-table-column>
          <el-table-column prop="FMEMO" label="备注"></el-table-column>
          <el-table-column fixed="left" label="操作" width="150">
            <template slot-scope="scope">
              <el-button @click.native.prevent="insert(scope.row.FCATNO)" icon="el-icon-edit" type="text" size="small">
                编辑
              </el-button>
              <el-popconfirm title="确定删除当前数据吗？" @confirm="Catdelete(scope.row.FCATNO)">
                <el-button slot="reference" icon="el-icon-delete" style="color: red;margin-left: 10px;"
                  type="text">删除</el-button>
              </el-popconfirm>
            </template>
          </el-table-column>
        </JNPF-table>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" />
        <Form ref="Form" :parelist="list" />
      </div>
    </div>
  </div>
</template>

<script>
  import Form from "./Form.vue"
  export default {
    name: 'shop',
    components: { Form },
    data() {
      return {
        showAll:false,
        fvisiblelist: [
          { id: "1", fullName: "男" },
          { id: "2", fullName: "女" },
        ],
        total: 0,
        list: [
        {
          "FHOME":"闵行春申小学",
          "FYEAR": 2024,
          "FPARENTNO": "一年级",
          "FCLASS":"1班",
          "FCATNO": "241001",
          "FCATNAME": "曹植",
          "FSEX": "男",
          "FMEMO": "",
          "FVISIBLE": 1,
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FHOME":"闵行春申小学",
          "FYEAR": 2024,
          "FPARENTNO": "一年级",
          "FCLASS":"1班",
          "FCATNO": "241002",
          "FCATNAME": "刘阿斗",
          "FSEX": "男",
          "FMEMO": "",
          "FVISIBLE": 1,
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FHOME":"闵行春申小学",
          "FYEAR": 2023,
          "FPARENTNO": "二年级",
          "FCLASS":"2班",
          "FCATNO": "242001",
          "FCATNAME": "小乔",
          "FSEX": "女",
          "FMEMO": "",
          "FVISIBLE": 1,
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FHOME":"闵行春申小学",
          "FYEAR": 2023,
          "FPARENTNO": "二年级",
          "FCLASS":"2班",
          "FCATNO": "222001",
          "FCATNAME": "大乔",
          "FSEX": "女",
          "FMEMO": "",
          "FVISIBLE": 1,
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        }
        ],

        //所属校区选择数据
        options1: [{
          value: '20E01',
          label: '闵行春申小学'
        }, {
          value: '20E02',
          label: '闵行莘城中学'
        }, {
          value: '20N01',
          label: '闵行莘松中学'
        }, {
          value: '20N02',
          label: '闵行莘庄中学'
        }],

        //所属校区选择数据
        options2: [{
          value: 'L001',
          label: '大一'
        }, {
          value: 'L002',
          label: '大二'
        }, {
          value: 'L003',
          label: '大三'
        }, {
          value: 'L004',
          label: '大四'
        }],

        //所属校区选择数据
        options3: [{
          value: 'L001',
          label: '24级化学系1班'
        }, {
          value: 'L002',
          label: '24级化学系2班'
        }],

        loading: false,
        listQuery: {
          page: 1,
          limit: 20,
          sort: "desc",
          sidx: "",
          fcatno: "",
          fcatname: ""
        },
      };
    },
    computed: {},
    created() {
    },
    methods: {
      insert(row) {
        this.$refs.Form.init(row);
      },
    },
  };
</script>